<?php

namespace App\Console\Commands;


use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Yurun\Util\HttpRequest;
use function EasyWeChat\Kernel\Support\generate_sign;


class bookAdd extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'book:add';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {

        $res1 = DB::statement("insert into user(id,username,password,address,birthday,department_id) values(?,'帅哥1','123456','四川成都','2018-06-01',2)", [rand(1, 100000)]);

        $res = DB::table('user')->offset(1)->limit(1000)->orderByDesc('id')->select('id')->get();
        var_dump($res1, sizeof($res));
        var_dump($res);
    }
}
